﻿using System.Configuration;
using System.Windows.Forms;

namespace Company.Interface
{
    public class GlobalSettings
    {
        public static readonly string CHO_TIEP_NHAN_COLOR;
        public static readonly string CHUA_DUYET_COLOR;
        public static readonly string CHUA_KHAI_BAO_COLOR;
        public static readonly string CUA_KHAU = ConfigurationManager.AppSettings["CUA_KHAU"];
        public static readonly string LOAI_HINH = ConfigurationManager.AppSettings["LOAI_HINH"];
        public static readonly string NHOM_LOAI_HINH = ConfigurationManager.AppSettings["NHOM_LOAI_HINH"];
        public static readonly string DA_DUYET_COLOR;
        public static readonly bool DAI_LY_TTHQ = false;
        public static readonly string DKGH_MAC_DINH = ConfigurationManager.AppSettings["DKGH_MAC_DINH"];
        public static readonly string DVT_MAC_DINH = ConfigurationManager.AppSettings["DVT_MAC_DINH"].PadRight(3);
        public static readonly string MA_CUC_HAI_QUAN = ConfigurationManager.AppSettings["MA_CUC_HAI_QUAN"];
        public static readonly string MA_DAI_LY = "";
        public static readonly string MA_DON_VI = ConfigurationManager.AppSettings["MA_DON_VI"];
        public static readonly string MA_HAI_QUAN = ConfigurationManager.AppSettings["MA_HAI_QUAN"].PadRight(6);
        public static readonly string TEN_HAI_QUAN = ConfigurationManager.AppSettings["TEN_HAI_QUAN"];
        public static readonly string NUOC = ConfigurationManager.AppSettings["NUOC"];
        public static readonly string NGUYEN_TE_MAC_DINH = ConfigurationManager.AppSettings["NGUYEN_TE_MAC_DINH"];
        public static readonly string PTTT_MAC_DINH = ConfigurationManager.AppSettings["PTTT_MAC_DINH"];
        public static readonly string PTVT_MAC_DINH = ConfigurationManager.AppSettings["PTVT_MAC_DINH"];
        public static readonly string TEN_CUC_HAI_QUAN = ConfigurationManager.AppSettings["TEN_CUC_HAI_QUAN"];
        public static readonly string TEN_DOI_TAC = ConfigurationManager.AppSettings["TEN_DOI_TAC"];
        public static readonly string TEN_DON_VI = ConfigurationManager.AppSettings["TEN_DON_VI"];
        public static readonly string TY_GIA_USD = ConfigurationManager.AppSettings["TY_GIA_USD"];
        public static readonly string CHENHLECH_THN_THX = ConfigurationManager.AppSettings["CL_THN_THX"];

        public static void KhoiTao_GiaTriMacDinh()
        {
            string settingFileName = Application.StartupPath + "\\ApplicationSettings.xml";
            ApplicationSettings settings = new ApplicationSettings();
            settings.ReadXml(settingFileName);

            DoanhNghiep.Ma = settings.DoanhNghiep[0].Ma;
            DoanhNghiep.Ten = settings.DoanhNghiep[0].Ten;

            HaiQuan.Ma = settings.HaiQuan[0].Ma;
            HaiQuan.Ten = settings.HaiQuan[0].Ten;
            HaiQuan.MaCuc = settings.HaiQuan[0].MaCuc;
        }

        #region Nested type: DoanhNghiep

        public struct DoanhNghiep
        {
            public static string Ma;
            public static string Ten;
        }

        #endregion

        #region Nested type: HaiQuan

        public struct HaiQuan
        {
            public static string Ma;
            public static string Ten;
            public static string MaCuc;
        }

        #endregion
    }
}